package cn.kgc.client;

import cn.kgc.base.vo.UmsMemberReceiveAddressVo;
import cn.kgc.commons.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;

/**
 * <p></p>
 *
 * @author 李孟鸠
 * @Date: 2023年01月02日10:42
 */
@Component
@Slf4j
public class UmsFeignClientImpl implements UmsFeignClient {
    @Override
    public Result<List<UmsMemberReceiveAddressVo>> getUmsMemberReceiveAddress(Long memberId) {
       log.error("获得用户：{},收获地址失败，服务接口降级",memberId);
       //注意:服务降级时的编码
        return Result.error(null,
                "http://mall-ums/umsMemberReceiveAddress/mylist", HttpStatus.OK.value(),"error");
    }

    @Override
    public Result<UmsMemberReceiveAddressVo> selectOne(Serializable id) {
       log.error("获得收获地址失败,服务接口降级,地址的ID:{}",id);
        return Result.error(null,"http://mall-ums/umsMemberReceiveAddress/{id}",HttpStatus.OK.value(),"error");
    }
}
